import Vue from 'vue'
import Vuex from 'vuex'

import app from './modules/app'
import user from './modules/user'
import getters from './getters'
import VuexPersistence from 'vuex-persist'
const vuexLocal = new VuexPersistence({
    storage: window.localStorage
})

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    app,
    user
  },
  state: {
    customerInfo: {},
    houseInfo:{}
  },
  mutations: {
    SET_CUSTOMERINFO: (state, customerInfo) => {
      state.customerInfo = customerInfo;
    },
    SET_HOUSEINFO: (state, houseInfo) => {
      state.houseInfo = houseInfo;
    }
  },
  actions: {
  },
  getters,
  plugins: [vuexLocal.plugin]
})
